package com.cl.pile.rule.filter;

import java.util.Date;

/**
 * @author chenyitao
 * @date 2021/3/5
 */
public class DateLtFilterOperation extends BaseDateOperation implements IFilterOperation {

    @Override
    public boolean filterMatch(Object value, String matchValue) {
        if (value == null || matchValue == null) {
            return false;
        }
        Date date1 = convertToDate(value);
        Date date2 = convertToDate(matchValue);
        if (date1 != null && date2 != null) {
            return date1.before(date2);
        }
        return false;
    }

    @Override
    public String filterName() {
        return "日期小于";
    }
}
